/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tesam.gedeon.controller;

import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.support.RequestContextUtils;

/**
 *
 * @author joelpacheco
 */
@Controller
public class ChangeLenguageController{
    
   
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response){
        System.out.println("Entro");
        try {
            RequestContextUtils.getLocaleResolver(request).setLocale(request, response, new Locale(request.getParameter("language")));
        } catch (Exception e) {
            System.out.println("Exeption-ChangeLenguaheController-handleRequest:" + e.getMessage());
        }
        return new ModelAndView("/rol/index");
    }
}
